package com.example.demo.demos.web.test;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author : jwp
 * @description :
 * @createDate : 2024/12/16 7:48
 */
public class AccessTokenDemo01 {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new FileReader("accessToken.txt"));
        StringBuffer stringBuffer = new StringBuffer();
        String line = null;
        while ( (line =br.readLine())!= null){
            stringBuffer.append(line);
        }
        String accessToken =stringBuffer.toString();
        JSONObject jsonObject = JSON.parseObject(accessToken);
        String accessToken1 = jsonObject.getString("accessToken");
        System.out.println(accessToken1);

    }
}
